<?php require_once('connections/con_gl.php'); ?>
<?php
cekAkses($_SESSION[akses],"PJ-7-2");
// -- get customer
mysql_select_db($database_con_gl, $con_gl);
$query_kontak = "SELECT id, nama, type, tcustomer FROM gl_kontak where gl_kontak.type ='Customer' ORDER BY type, nama ASC";
$kontak = mysql_query($query_kontak, $con_gl) or die(mysql_error());
$row_kontak = mysql_fetch_assoc($kontak);
$totalRows_kontak = mysql_num_rows($kontak);
// get paket
mysql_select_db($database_con_gl, $con_gl);
$query_kelom = "SELECT id, kelompok FROM gl_kelompok where jual=1 AND jenis=2 ORDER BY kelompok DESC";
$kelom = mysql_query($query_kelom, $con_gl) or die(mysql_error());
$row_kelom = mysql_fetch_assoc($kelom);
$totalRows_kelom = mysql_num_rows($kelom);
// --- lokasi kantor


// salesman
mysql_select_db($database_con_gl, $con_gl);
$query_salesmen = "SELECT gl_kontak.id, gl_kontak.nama FROM gl_kontak WHERE gl_kontak.type='Karyawan' AND tkaryawan='sales' order by nama";
$salesmen = mysql_query($query_salesmen, $con_gl) or die(mysql_error());
$row_salesmen = mysql_fetch_assoc($salesmen);
$totalRows_salesmen = mysql_num_rows($salesmen);
// query edit
mysql_select_db($database_con_gl, $con_gl);
$query_edit = "SELECT * FROM gl_retailtrans a inner join  gl_detailtrans b on a.no_ref = b.no_ref LEFT JOIN gl_kontak k on a.pengemudi = k.id WHERE a.no_ref = '$_GET[noreferensi]'";
$edit = mysql_query($query_edit, $con_gl) or die(mysql_error());
$row_edit = mysql_fetch_assoc($edit);
$totalRows_edit = mysql_num_rows($edit);
// get transaksi
mysql_select_db($database_con_gl, $con_gl);
$query_tr = "SELECT gl_trans.id, gl_trans.total, gl_trans.jumlah, gl_trans.hargasatuan, gl_trans.transaksi, gl_trans.diskon, gl_akun.akun, gl_akun.id as akun_id, gl_barang.id as brg_id, gl_barang.barang, gl_trans.kendaraan, gl_satuan.satuan FROM gl_trans, gl_akun, gl_barang, gl_satuan WHERE gl_akun.id = gl_trans.akun AND gl_barang.id = gl_trans.barang AND gl_satuan.id = gl_trans.satuan AND gl_trans.no_ref='$_GET[noreferensi]' AND gl_trans.pos='K' ORDER BY gl_trans.id desc";
$tr = mysql_query($query_tr, $con_gl) or die(mysql_error());
$row_tr = mysql_fetch_assoc($tr);
if($row_tr['jumlah'] == 0) $row_tr['jumlah'] = 1;
$totalRows_tr = mysql_num_rows($tr);

// get a_kas
mysql_select_db($database_con_gl, $con_gl);
$query_getkas = "select a_kas from gl_gudang 
inner join gl_trans on gl_gudang.a_kas = gl_trans.akun where gl_trans.kode = 'SJ' AND gl_trans.no_ref = '$_GET[noreferensi]'";
$getkas = mysql_query($query_getkas, $con_gl) or die(mysql_error());
$row_getkas = mysql_fetch_assoc($getkas);
$totalRows_getkas = mysql_num_rows($getkas);

// get a_piu
mysql_select_db($database_con_gl, $con_gl);
$query_getpiu = "select a_piu from gl_gudang 
inner join gl_trans on gl_gudang.a_piu = gl_trans.akun where gl_trans.kode = 'SJ' AND gl_trans.no_ref = '$_GET[noreferensi]'";
$getpiu = mysql_query($query_getpiu, $con_gl) or die(mysql_error());
$row_getpiu = mysql_fetch_assoc($getpiu);
$totalRows_getpiu = mysql_num_rows($getpiu);


// get a_beb
mysql_select_db($database_con_gl, $con_gl);
$query_getbeb = "select a_beb from gl_gudang 
inner join gl_trans on gl_gudang.a_beb = gl_trans.akun where gl_trans.kode = 'SJ' AND gl_trans.no_ref = '$_GET[noreferensi]'";
$getbeb = mysql_query($query_getbeb, $con_gl) or die(mysql_error());
$row_getbeb = mysql_fetch_assoc($getbeb);
$totalRows_getbeb = mysql_num_rows($getbeb);

// get a_paj
mysql_select_db($database_con_gl, $con_gl);
$query_getpaj = "select a_paj from gl_gudang 
inner join gl_trans on gl_gudang.a_paj = gl_trans.akun where gl_trans.kode = 'SJ' AND gl_trans.no_ref = '$_GET[noreferensi]'";
$getpaj = mysql_query($query_getpaj, $con_gl) or die(mysql_error());
$row_getpaj = mysql_fetch_assoc($getpaj);
$totalRows_getpaj = mysql_num_rows($getpaj);

// get a_hpp

// get a_pend
mysql_select_db($database_con_gl, $con_gl);
$query_getpnd = "select a_pend from gl_gudang 
inner join gl_trans on gl_gudang.a_pend = gl_trans.akun where gl_trans.kode = 'SJ' AND gl_trans.no_ref = '$_GET[noreferensi]'";
$getpnd= mysql_query($query_getpnd, $con_gl) or die(mysql_error());
$row_getpnd = mysql_fetch_assoc($getpnd);
$totalRows_getpnd = mysql_num_rows($getpnd);
// get a_jasadriver
mysql_select_db($database_con_gl, $con_gl);
$query_getjasadriver = "select a_jasadriver from gl_gudang 
inner join gl_trans on gl_gudang.a_jasadriver = gl_trans.akun where gl_trans.kode = 'SJ' AND gl_trans.no_ref = '$_GET[noreferensi]'";
$getjasadriver = mysql_query($query_getjasadriver, $con_gl) or die(mysql_error());
$row_getjasadriver = mysql_fetch_assoc($getjasadriver);
$totalRows_getjasadriver = mysql_num_rows($getjasadriver);

// get a_insentifdriver
mysql_select_db($database_con_gl, $con_gl);
$query_getinsentifdriver = "select a_insentifdriver from gl_gudang 
inner join gl_trans on gl_gudang.a_insentifdriver = gl_trans.akun where gl_trans.kode = 'SJ' AND gl_trans.no_ref = '$_GET[noreferensi]'";
$getinsentifdriver = mysql_query($query_getinsentifdriver, $con_gl) or die(mysql_error());
$row_getinsentifdriver = mysql_fetch_assoc($getinsentifdriver);
$totalRows_getinsentifdriver = mysql_num_rows($getinsentifdriver);


// get a_bbm
mysql_select_db($database_con_gl, $con_gl);
$query_getbbm = "select a_bbm from gl_gudang 
inner join gl_trans on gl_gudang.a_bbm = gl_trans.akun where gl_trans.kode = 'SJ' AND gl_trans.no_ref = '$_GET[noreferensi]'";
$getbbm = mysql_query($query_getbbm, $con_gl) or die(mysql_error());
$row_getbbm = mysql_fetch_assoc($getbbm);
$totalRows_getbbm = mysql_num_rows($getbbm);

// get a_pph
mysql_select_db($database_con_gl, $con_gl);
$query_getpph = "select a_pph from gl_gudang 
inner join gl_trans on gl_gudang.a_pph = gl_trans.akun where gl_trans.kode = 'SJ' AND gl_trans.no_ref = '$_GET[noreferensi]'";
$getpph = mysql_query($query_getpph, $con_gl) or die(mysql_error());
$row_getpph= mysql_fetch_assoc($getpph);
$totalRows_getpph = mysql_num_rows($getpph);



// --- lokasi kantor
mysql_select_db($database_con_gl, $con_gl);
$query_gudang = "SELECT * FROM gl_gudang where id='$_SESSION[lokasi]'";

$query_gudang .=" ORDER BY gudang ASC"; 
$gudang = mysql_query($query_gudang, $con_gl) or die(mysql_error());
$row_gudang = mysql_fetch_assoc($gudang);
$totalRows_gudang = mysql_num_rows($gudang);


// get kendaraan
mysql_select_db($database_con_gl, $con_gl);
$query_kend = "select a.tipekendaraan, b.nopolisi from gl_tipekendaraan a ,gl_masterkendaraan b, gl_jenbar c where a.id = b.tipekendaraan AND c.barang='$row_tr[brg_id]' AND a.id = c.jenis AND b.tersedia='1' order by a.tipekendaraan, b.nopolisi";
$kend       = mysql_query($query_kend, $con_gl) or die(mysql_error());
$row_kend   = mysql_fetch_assoc($kend);
$total_kend = mysql_num_rows($kend);
// get detailtransaksi
mysql_select_db($database_con_gl, $con_gl);
$query_detail = "SELECT * FROM gl_detailtrans WHERE gl_detailtrans.no_ref='$_REQUEST[noreferensi]'";
$detail = mysql_query($query_detail, $con_gl) or die(mysql_error());
$row_detail = mysql_fetch_assoc($detail);
$totalRows_getidh = mysql_num_rows($detail);

?>
<link href="ccss/ui.datepicker.css" type="text/css" rel="stylesheet" />
<style>
#cusinfo tr td {
	font-size:10px;	
}
</style>
<script type="text/javascript" src="js/ui.datepicker.js"></script>
<script type="text/javascript">
<!--
$(function()
      {
        $('.calendar').datepicker({
            appendText : "",
            dateFormat : 'yy/mm/dd'
          });
      });
	  
</script>
<script type="text/javascript">
function bbm()
{
javascript:this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value;

}
function tol(){
javascript:this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value;
}
function parkir()
{
this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value;
}

function feeDriver()
{
this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value;
}
function akomodasi() {
this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value;
}
function other()
{
this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value;
}
function msg(){
alert('grandtotal');
}
</script>
<script type="text/javascript" src="js/ajax_data.js"></script>
<script type="text/javascript">
$(document).ready(function() {

	$().ajaxStart(function() {
		$('#loading').show();
		$('#result').hide();
	}).ajaxStop(function() {
		$('#loading').hide();
		$('#result').fadeIn('slow');
	});

	$('#edit').submit(function() {
		$.ajax({
			type: 'POST',
			url: $(this).attr('action'),
			data: $(this).serialize(),
			success: function(data) {
				$('#result').html(data);
			}
		})
		return false;
	});
  $('#result').click(function(){
  $(this).hide();
  });
})
</script>
<div id="loading" style="display:none;"><img src="images/loading.gif" alt="loading..." /></div>
<div id="result" style="display:none;"></div>
<h1>Edit Transaksi Order</h1>
<div id="divDetail"><table width="100%" border="0" cellspacing="0" cellpadding="4" class="datatable" id="cusinfo">
  <tr>
    <th colspan="4" align="center">INFORMASI PELANGGAN</th>
  </tr>
  <tr>
    <td align="right" valign="top" style="background:#FFF;"><div align="left">INFO PEMESAN </div></td>
    <td width="33%" valign="top" style="background:#FFF;">&nbsp;</td>
    <td valign="top" style="background:#FFF;">INFO PENJAMIN </td>
    <td width="31%" valign="top" style="background:#FFF;">&nbsp;</td>
  </tr>
  <tr>
    <td align="right" valign="top" style="background:#FFF;">NPWP :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td width="16%" align="right" valign="top" style="background:#FFF;">Nama :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
  </tr>
  <tr>
    <td width="20%" align="right" valign="top" style="background:#FFF;">Nama :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td align="right" valign="top" style="background:#FFF;">Alamat :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
  </tr>
  <tr>
    <td align="right" valign="top" style="background:#FFF;">Alamat :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td align="right" valign="top" style="background:#FFF;">No. Tlp :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
  </tr>
  <tr>
    <td align="right" valign="top" style="background:#FFF;">No. Tlp :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td align="right" valign="top" style="background:#FFF;">Jabatan : </td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
  </tr>
  <tr>
    <td align="right" valign="top" style="background:#FFF;">Email :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
  </tr>
  
  <tr>
    <td align="right" valign="top" style="background:#FFF;">Keterangan :</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
    <td valign="top" style="background:#FFF;">&nbsp;</td>
  </tr>
</table>
</div>
<form action="proses/sretail.php?act=edit" method="POST" name="edit" id="edit" >
  <table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" class="datatable">
    <tr>
      <th colspan="2">Tanggal Reservasi </th>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <th colspan="3">Rincian Biaya Sewa Kendaraan </th>
    </tr>
    <tr>
      <td width="15%" align="right" valign="top" bgcolor="#FFFFFF">No Order *: </td>
      <td width="36%" valign="top" bgcolor="#FFFFFF"><div id="refDiv">
        <label>
          <input name="noreferensi" type="text" id="noreferensi" value="<?php echo $row_edit['no_ref']; ?>" size="31" maxlength="31" onchange="cekReferensis(this.value);" onfocus="this.blur();"/>
        </label>
      </div></td>
      <td width="1%" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right" valign="top"> Diskon 
		<input name="diskon" type="text" id="diskon" onkeyup="javascript: if(this.value=='') this.value='0'; this.value=parseFloat(this.value);  var jmlhari = parseInt(document.getElementById('jumlah').value); if(document.getElementById('xharga')) {  var harga =document.getElementById('xharga').value * jmlhari;}
else {var harga = document.getElementById('hargasatuansebelum').value * jmlhari;}; 
document.getElementById('hargasatuan').value=harga - (harga * (this.value/100)); document.getElementById('txtdiskon').value=harga*this.value/100;		document.getElementById('hargaafterppn').value=parseFloat(document.getElementById('hargasatuan').value) * (document.getElementById('ppn').value/100); 
var total=parseInt(document.getElementById('bbm').value) + parseInt(document.getElementById('tol').value) + parseInt(document.getElementById('parkir').value) + parseInt(document.getElementById('supir').value) + parseInt(document.getElementById('akomodasi').value) + parseInt(document.getElementById('other').value); 
var grandtotal = parseInt(document.getElementById('hargasatuan').value) + parseInt(document.getElementById('hargaafterppn').value) + total - parseInt(document.getElementById('uangmuka').value);
document.getElementById('biaya').value=total; document.getElementById('ntotal').value=grandtotal; " value="0" size="2" maxlength="2" />
%&nbsp;<input type="text" name="txtdiskon" id="txtdiskon" size="10" value="<?php echo $row_edit['diskonamount']; ?>" onkeyup="javascript: if(this.value=='') this.value='0'; this.value=parseFloat(this.value); var jmlhari = parseInt(document.getElementById('jumlah').value); if(document.getElementById('xharga')) {  var harga =document.getElementById('xharga').value * jmlhari;}
else {var harga = document.getElementById('hargasatuansebelum').value * jmlhari;} document.getElementById('diskon').value=100*(parseInt(this.value)/harga); document.getElementById('hargasatuan').value=harga - parseFloat(this.value); document.getElementById('hargaafterppn').value=parseFloat(document.getElementById('hargasatuan').value) * (document.getElementById('ppn').value/100);
document.getElementById('hargaafterpph').value=parseFloat(document.getElementById('hargasatuan').value) * (document.getElementById('pph').value/100);
var total=parseInt(document.getElementById('bbm').value) + parseInt(document.getElementById('tol').value) + parseInt(document.getElementById('parkir').value) + parseInt(document.getElementById('supir').value) + parseInt(document.getElementById('akomodasi').value) + parseInt(document.getElementById('other').value); 
var grandtotal = parseInt(document.getElementById('hargasatuan').value) + parseInt(document.getElementById('hargaafterppn').value) + total - parseInt(document.getElementById('uangmuka').value) - parseInt(document.getElementById('hargaafterpph').value);
document.getElementById('biaya').value=total; document.getElementById('ntotal').value=grandtotal;"/>&nbsp;-&nbsp;Harga Rp.: </td>
      <td width="28%" valign="top" bgcolor="#FFFFFF"><label></label>
        <label id="divHargaKendaraan">
          <input name="hargasatuan" type="text" id="hargasatuan" value="<?php echo ($row_edit['hargasatuan'] * $row_edit['jmlhr']  - $row_edit['diskonamount']);?>"/>
          
      </label></td>
	  <td><input name="hargasatuansebelum" type="hidden" id="hargasatuansebelum" value="<?php echo $row_edit['hargasatuan'];?>"/></td>
    </tr>
    <tr valign="top">
      <td align="right" valign="top" bgcolor="#FFFFFF">Tanggal Order *: </td>
      <td valign="top" bgcolor="#FFFFFF"><label>
        <input name="tanggal" type="text" class="calendar" id="tanggal" value="<?php echo $row_edit['tgl']; ?>" size="12" maxlength="12"/>
      </label>
        <label></label></td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right">PPN
		<input name="ppn" type="text" id="ppn" value="<?php echo $row_detail['ppn'] / ($row_detail['hargasatuan'] - $row_detail['diskonamount']) * 100; ?>" size="3" maxlength="10" onkeyup="javascript: if(this.value=='') {this.value='0'; this.value=parseFloat(this.value); document.getElementById('pph').value='0';}
        else if(this.value=='' || this.value=='0')
        {
           document.getElementById('pph').value='0';
           document.getElementById('a_pph').value='';
           document.getElementById('a_paj').value='';
        }
        else { 
           document.getElementById('a_pph').value=<?php echo $row_gudang['a_pph'];?>;
           document.getElementById('a_paj').value=<?php echo $row_gudang['a_paj'];?>;
        document.getElementById('pph').value='2';} this.value=parseFloat(this.value); document.getElementById('hargaafterppn').value=document.getElementById('hargasatuan').value*(this.value/100);        document.getElementById('hargaafterpph').value=document.getElementById('hargasatuan').value*(parseInt(document.getElementById('pph').value)/100); 
var total=parseInt(document.getElementById('bbm').value) + parseInt(document.getElementById('tol').value) + parseInt(document.getElementById('parkir').value) + parseInt(document.getElementById('supir').value) + parseInt(document.getElementById('akomodasi').value) + parseInt(document.getElementById('other').value); 
var grandtotal = parseInt(document.getElementById('hargasatuan').value) + parseInt(document.getElementById('hargaafterppn').value) + total - parseInt(document.getElementById('uangmuka').value) - parseInt(document.getElementById('txtdiskon').value) - parseInt(document.getElementById('hargaafterpph').value);;
document.getElementById('biaya').value=total; document.getElementById('ntotal').value=grandtotal; " />
        % - Rp. :</td>
      <td bgcolor="#FFFFFF">
		<label id="divHargaPPN">
	  <input name="hargaafterppn" type="text" id="hargaafterppn" value="<?php if($row_edit['ppn']=="") echo "0"; else echo $row_edit['ppn']; ?>" size="20" maxlength="100" onfocus="this.blur();" style="text-align:right;"/>
	  </label>	</td>
    </tr>
    <tr valign="top">
      <td align="right" valign="top" bgcolor="#FFFFFF">Area * :</td>
      <td valign="top" class="datatable">
		
	  <?php list($idarea, $namaarea,$idcabang,$cabang) = mysql_fetch_row(mysql_query("select a.area as idarea, b.area,g.id as idcabang,g.gudang as cabang from gl_retailtrans a inner join gl_area b on a.area = b.id
inner join gl_gudang g on a.gudang = g.id where a.no_ref = '$_GET[noreferensi]';")); ?>
	  <input type="hidden" name="area" id="area" value="<?php echo $idarea; ?>" />
	  <input type="text" readonly="readonly" name="txtarea" id="txtarea" size="28" value="<?php echo $namaarea; ?>" style="background-color:#fff;border:1px solid #999; height:16px;"/>
	  <?php if(strstr($_SESSION['akses'],"PD-6-1")) { ?>
	  <?php } ?>	  &nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp; 
		<!-- Added by suwondo -->	  </td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right">PPh 23
        <input name="pph" type="text" id="pph" value="<?php echo $row_detail['pph'] / ($row_detail['hargasatuan'] - $row_detail['diskonamount']) * 100; ?>" size="3" maxlength="10"/>
      %      Rp. :</td>
      <td bgcolor="#FFFFFF"><input name="hargaafterpph" type="text" id="hargaafterpph" value="<?php if($row_edit['pph']=="") echo "0"; else echo $row_edit['pph']; ?>" size="20" maxlength="100" onfocus="this.blur();" style="text-align:right;"/></td>
    </tr>
    <tr valign="top">
      <td width="15%" align="right" valign="top" bgcolor="#FFFFFF">Cabang * : </td>
      <td width="36%" valign="top" bgcolor="#FFFFFF"><input type="hidden" name="gudang" id="cabang" value="<?php echo $idcabang; ?>" />
	  <input type="hidden" name="cabang" id="cabang" value="<?php echo $idarea; ?>" />
	  <input type="text" name="txtcabang" id="txtcabang" size="28" value="<?php echo $cabang; ?>" readonly="readonly" style="background-color:#fff;border:1px solid #999; height:16px;"/>
        <?php if(strstr($_SESSION['akses'],"PD-7-1")) { ?>
      <?php } ?>	  </td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td width="10%" align="right">Biaya Operasional </td>
      <td width="10%" align="right">BBM Rp.: </td>
      <td bgcolor="#FFFFFF"><label id="divBBM">
        <input name="bbm" type="text" id="bbm" value="<?php echo $row_edit['bbm'];?>" size="20" maxlength="10" onkeyup="javascript:this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value; var total=parseInt(document.getElementById('bbm').value) + parseInt(document.getElementById('tol').value) + parseInt(document.getElementById('parkir').value) + parseInt(document.getElementById('supir').value) + parseInt(document.getElementById('akomodasi').value) + parseInt(document.getElementById('other').value); 
var grandtotal = parseInt(document.getElementById('hargasatuan').value) + parseInt(document.getElementById('hargaafterppn').value) + parseInt(total) - parseInt(document.getElementById('uangmuka').value) - parseInt(document.getElementById('hargaafterpph').value);
document.getElementById('biaya').value=total; document.getElementById('ntotal').value=grandtotal;" style="text-align:right;"/>
      </label></td>
    </tr>
    <tr valign="top">
      <td width="15%" align="right" bgcolor="#FFFFFF">Customer *:</td>
      <td width="36%" bgcolor="#FFFFFF"><!--
	  <label>
        <input name="qtxt" type="text" id="qtxt" value="Cari Nama/No. Telp ..." size="23" maxlength="100" onclick="this.value='';" onkeypress="browseKontak('Customer');"/>
      </label>
        <label id="divKontak">
          <select name="dari" id="dari" onchange="setKeterangan(this.value);getDetailCustomer(this.value);" style="width:150px;">
            <option value="" <?php if (!(strcmp("", $row_edit['kontak']))) {echo "selected=\"selected\"";} ?>>Pilih Customer</option>
            <?php
			do {  
			?>
						<option value="<?php echo $row_kontak['id']?>" <?php if($row_edit['kontak']==$row_kontak['id']) { ?>selected="selected"<?php } ?>><?php echo $row_kontak['nama']?></option>
						<?php
			} while ($row_kontak = mysql_fetch_assoc($kontak));
			  $rows = mysql_num_rows($kontak);
			  if($rows > 0) {
				  mysql_data_seek($kontak, 0);
				  $row_kontak = mysql_fetch_assoc($kontak);
			  }
			?>
          </select>
        </label>
		-->
          <!-- Added by suwondo -->
          <input type="hidden" name="dari" id="dari" value="<?php echo $row_edit['kontak']; ?>" />
          <?php list($kontak) = mysql_fetch_row(mysql_query("select nama from gl_kontak where id = '$row_edit[kontak]'"));?>
          <input type="text" name="qtxt" id="qtxt" value="<?php echo $kontak; ?>" placeholder="Cari Customer ..." size="28" readonly="readonly" style="background-color:#fff;border:1px solid #999; height:16px;" onclick="NewWindow('index.php?component=kontak&task=listcustomerretail&open=window','name','825','450','yes');return false" />
        <script>window.getDetailCustomer('<?php echo $row_edit['kontak']; ?>');window.setKeterangan('<?php echo $row_edit['kontak']; ?>');</script>
        <?php if(strstr($_SESSION['akses'],"DD-2-1")) { ?>
      <?php } ?>      </td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right">Tol  Rp.: </td>
      <td bgcolor="#FFFFFF"><label id="divTol">
        <input name="tol" type="text" id="tol" value="<?php echo $row_edit['tol'];?>" size="20" maxlength="10"  onkeyup="javascript:this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value; var total=parseInt(document.getElementById('bbm').value) + parseInt(document.getElementById('tol').value) + parseInt(document.getElementById('parkir').value) + parseInt(document.getElementById('supir').value) + parseInt(document.getElementById('akomodasi').value) + parseInt(document.getElementById('other').value); 
var grandtotal = parseInt(document.getElementById('hargasatuan').value) + parseInt(document.getElementById('hargaafterppn').value) + parseInt(total) - parseInt(document.getElementById('uangmuka').value) - parseInt(document.getElementById('hargaafterpph').value);
document.getElementById('biaya').value=total; document.getElementById('ntotal').value=grandtotal;" style="text-align:right;"/>
      </label></td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">Paket Sewa *: </td>
      <td bgcolor="#FFFFFF">
          <!-- Added by suwondo -->
          <input type="hidden" name="barang" id="barang" value="<?php echo $row_edit['barang']; ?>" />
          <?php list($barang) = mysql_fetch_row(mysql_query("SELECT barang FROM gl_barang where id = '$row_edit[barang]' "));?>
          <input type="text" name="txtbarang" id="txtbarang" value="<?php echo $barang; ?>" placeholder="Cari Paket Sewa ..." size="30" readonly="readonly" style="background-color:#fff;border:1px solid #999; height:16px;" onclick="NewWindow('index.php?component=barang&task=list&kelompok=<?php echo $row_kelom['id']; ?>&area='+document.getElementById('area').value+'&open=window','name','825','450','yes');return false" />      </td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right">Parkir Rp.:</td>
      <td bgcolor="#FFFFFF"><label id="divParkir">
        <input name="parkir" type="text" id="parkir" value="<?php echo $row_edit['parkir'];?>" size="20" maxlength="10"  onkeyup="javascript:this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value; var total=parseInt(document.getElementById('bbm').value) + parseInt(document.getElementById('tol').value) + parseInt(document.getElementById('parkir').value) + parseInt(document.getElementById('supir').value) + parseInt(document.getElementById('akomodasi').value) + parseInt(document.getElementById('other').value); 
var grandtotal = parseInt(document.getElementById('hargasatuan').value) + parseInt(document.getElementById('hargaafterppn').value) + parseInt(total) - parseInt(document.getElementById('uangmuka').value) - parseInt(document.getElementById('hargaafterpph').value);
document.getElementById('biaya').value=total; document.getElementById('ntotal').value=grandtotal;" style="text-align:right;"/>
      </label></td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Kendaraan *: </td>
      <td valign="top" bgcolor="#FFFFFF"><!--
		<label id="divListKendaraan">
        <select name="kendaraan" id="kendaraan" style="width:180px;" onChange="getHargaKendaraan();getBiayaBBM();getBiayaTol();getBiayaParkir();getBiayaSupir();getBiayaAkomodasi();getBiayaOther();">
       </label> -->
          <!-- Added by suwondo -->
                    
          <?php
	  list($idkendaraan, $kendaraaan, $nopolisi) = mysql_fetch_row(mysql_query("select b.id, a.tipekendaraan, b.nopolisi from gl_tipekendaraan as a inner join gl_masterkendaraan as b on (a.id = b.tipekendaraan) inner join gl_jenbar as c on (a.id = c.jenis) where b.nopolisi = '$row_edit[kendaraan]'"));
	  ?>
      		
            <input type="hidden" name="kendaraan" id="kendaraan" value="<?php echo $nopolisi;?>"/>
          <input type="text" name="txtkendaraan" id="txtkendaraan" value="<?php echo $nopolisi; ?>" placeholder="Cari Kendaraan ..." size="30" style="background-color:#fff;border:1px solid #999; height:16px;" onclick="NewWindow('index.php?component=kendaraan&task=list&barang='+document.getElementById('barang').value+'&area='+document.getElementById('area').value+'&open=window','name','1200','600','yes');return false" />      </td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right" valign="top">Jasa Supir Rp.: </td>
      <td valign="top" bgcolor="#FFFFFF"><label id="divSupir">
        <input name="supir" type="text" id="supir" value="<?php echo $row_edit['supir'];?>" size="20" maxlength="10" onkeyup="javascript:this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value; var total=parseInt(document.getElementById('bbm').value) + parseInt(document.getElementById('tol').value) + parseInt(document.getElementById('parkir').value) + parseInt(document.getElementById('supir').value) + parseInt(document.getElementById('akomodasi').value) + parseInt(document.getElementById('other').value); 
var grandtotal = parseInt(document.getElementById('hargasatuan').value) + parseInt(document.getElementById('hargaafterppn').value) + parseInt(total) - parseInt(document.getElementById('uangmuka').value) - parseInt(document.getElementById('hargaafterpph').value);
document.getElementById('biaya').value=total; document.getElementById('ntotal').value=grandtotal;" style="text-align:right;"/>
      </label></td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Kota / Tempat Tujuan : </td>
      <td valign="top" bgcolor="#FFFFFF"><input name="tujuan" type="text" id="tujuan" value="<?php echo $row_edit['tujuan']; ?>" size="30" maxlength="100" /></td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right" valign="top">Uang Makan Rp.: </td>
      <td valign="top" bgcolor="#FFFFFF"><label id="divAkomodasi">
        <input name="akomodasi" type="text" id="akomodasi" value="<?php echo $row_edit['akomod'];?>" size="20" maxlength="10"  onkeyup="javascript:this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value; var total=parseInt(document.getElementById('bbm').value) + parseInt(document.getElementById('tol').value) + parseInt(document.getElementById('parkir').value) + parseInt(document.getElementById('supir').value) + parseInt(document.getElementById('akomodasi').value) + parseInt(document.getElementById('other').value); 
var grandtotal = parseInt(document.getElementById('hargasatuan').value) + parseInt(document.getElementById('hargaafterppn').value) + parseInt(total) - parseInt(document.getElementById('uangmuka').value) - parseInt(document.getElementById('hargaafterpph').value);
document.getElementById('biaya').value=total; document.getElementById('ntotal').value=grandtotal;" style="text-align:right;"/>
      </label></td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Tanggal Pemakaian : </td>
      <td valign="top" bgcolor="#FFFFFF"><label>
        <input name="checkin" readonly="readonly" type="text" class="calendar" id="checkin" value="<?php echo $row_edit['checkin'];?>" size="12" maxlength="12" onfocus="javascript: kirimRequest('include/cek_tanggal.php', 'tanggal='+this.value+'&interval='+document.getElementById('jumlah').value+'&type=day', 'checkout', ''); " onchange="javascript: kirimRequest('include/cek_tanggal.php', 'tanggal='+this.value+'&interval='+document.getElementById('jumlah').value+'&type=day', 'checkout', ''); " onclick="javascript: kirimRequest('include/cek_tanggal.php', 'tanggal='+this.value+'&interval='+document.getElementById('jumlah').value+'&type=day', 'checkout', ''); " />
        </label>
        - Jam :
  <label>
  <input name="waktucheckin" type="text" class="jam" id="waktucheckin" value="<?php echo $row_edit['waktucheckin'];?>" size="5" maxlength="5" onkeyup="javascript: if((this.value).match('_')==null) document.getElementById('jmlhwkt').focus(); "/>
</label></td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
	  <td colspan="2" align="right" valign="top">Biaya lain-lain Rp.: </td>
	  <td valign="top" bgcolor="#FFFFFF"><label id="divOther">
        <input name="other" type="text" id="other" value="<?php echo $row_edit['other'];?>" size="20" maxlength="10"  onkeyup="javascript:this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value; var total=parseInt(document.getElementById('bbm').value) + parseInt(document.getElementById('tol').value) + parseInt(document.getElementById('parkir').value) + parseInt(document.getElementById('supir').value) + parseInt(document.getElementById('akomodasi').value) + parseInt(document.getElementById('other').value); 
var grandtotal = parseInt(document.getElementById('hargasatuan').value) + parseInt(document.getElementById('hargaafterppn').value) + parseInt(total) - parseInt(document.getElementById('uangmuka').value) - parseInt(document.getElementById('hargaafterpph').value);
document.getElementById('biaya').value=total; document.getElementById('ntotal').value=grandtotal;" style="text-align:right;"/>
      </label></td>
	  <?php 
			$grand = intval($row_tr['hargasatuan'] * $row_tr['jumlah'] - ($row_tr['diskon']*($row_tr['hargasatuan']*$row_tr['jumlah']) / 100) + $row_getbiaya[total] + $row_getpajak[total]); 
			$ppn = $row_getpajak['total'] / ($row_tr['hargasatuan'] * $row_tr['jumlah'] - ($row_tr['diskon']*($row_tr['hargasatuan']*$row_tr['jumlah']) / 100)) * 100;
			$after = $grand - $ppn;
			$diskon = (($grand - $after)/$grand * 100);
			$totalDiskon = $row_getbiaya['total'] * ($diskon/100);
			?>
	  <!--
      <td align="right" valign="top">PPN 
        <input name="bobot" type="text" id="bobot" value="<?php echo $row_getpajak['total'] / ($row_tr['hargasatuan'] * $row_tr['jumlah'] - ($row_tr['diskon']*($row_tr['hargasatuan']*$row_tr['jumlah']) / 100)) * 100;?>" size="3" maxlength="3" onchange="javascript:this.form.pajak.value = (this.form.hargasatuan.value * this.form.bobot.value) / 100;this.form.ntotal.value = (2*this.form.hargasatuan.value) - this.form.hargasatuan.value + (2*this.form.pajak.value) - this.form.pajak.value + (2*this.form.biaya.value) - this.form.biaya.value;"/>
%        :</td>
      <td valign="top" bgcolor="#FFFFFF"><input name="pajak" type="text" id="pajak" value="<?php echo $row_getpajak['total']; ?>" size="15" maxlength="100" onfocus="this.blur();"/></td> -->
    </tr>
	<tr>
	  <td align="right" valign="top" bgcolor="#FFFFFF">Lama Sewa :</td>
	  <td valign="top" bgcolor="#FFFFFF"><label>
        <input name="jumlah" type="text" id="jumlah" onkeyup="javascript: if(this.value=='') this.value='0'; this.value=parseFloat(this.value); if(isNaN(this.value)){ alert('Harus Angka'); this.value='0'; }else{ kirimRequest('include/cek_tanggal.php', 'tanggal='+document.getElementById('checkin').value+'&interval='+this.value+'&type=day', 'checkout', ''); getHargaKendaraan();getBiayaBBM();getBiayaTol();getBiayaParkir();getBiayaSupir();getBiayaAkomodasi();getBiayaOther();getBiayaOprs(); getTotal(); getGrandTotal(); } 
	  document.getElementById('hargasatuan').value=this.value; " onfocus="javascript: kirimRequest('include/cek_tanggal.php', 'tanggal='+document.getElementById('checkin').value+'&interval='+this.value+'&type=day', 'checkout', ''); " value="<?php echo $row_edit['jmlhr']; ?>" size="3" maxlength="5" autocomplete="off" />
        </label>
	    ( Jlmh Hari ) /
  <?php
		list($jmlhwkt) = mysql_fetch_row(mysql_query("select jam from gl_barang where id='$row_tr[brg_id]'"));
		?>
  <input name="jmlhwkt" type="text" readonly="readonly" id="jmlhwkt" value="<?php echo $row_edit['jmlwkt']; ?>" size="3" maxlength="2" onfocus="javascript: 		kirimRequest('include/cek_tanggal.php','tanggal='+document.getElementById('checkin').value+'&waktu='+document.getElementById('waktucheckin').value+'&interval='+this.value+'&type=hour','checkout','');" onkeyup="javascript: if(this.value=='') this.value='0'; this.value=parseFloat(this.value); 
		if(isNaN(this.value)){
			alert('Harus Angka');this.value='0';
		}else{
			if(this.value>=24){
				var hari=Math.floor(parseInt(this.value)/24); 
				this.value=parseInt(this.value)-(hari*24); 
				document.getElementById('jumlah').value=hari; 
				document.getElementById('jumlah').focus(); 
				document.getElementById('jumlah').select(); 
			} kirimRequest('include/cek_tanggal.php','tanggal='+document.getElementById('checkin').value+'&waktu='+document.getElementById('waktucheckin').value+'&interval='+this.value+'&type=hour','checkout','');
		}" onkeydown="javascript:if(this.value=='0')this.value='';" onclick="javascript:this.select();" onchange="javascript: kirimRequest('include/cek_tanggal.php','tanggal='+document.getElementById('checkin').value+'&waktu='+document.getElementById('waktucheckin').value+'&interval='+this.value+'&type=hour','checkout','');" autocomplete="off" />
	    (Jmlh Jam)</td>
	  <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
		<th colspan="2" align="right" valign="top">Total Biaya : </th>
		<td valign="top" bgcolor="#FFFFFF"><label>
          <input name="biaya" type="text" id="biaya" readonly="readonly" value="<?php echo ($row_edit['supir'] + $row_edit['bbm'] + $row_edit['tol']+$row_edit['parkir'] + $row_edit['akomod'] + $row_edit['other']); ?>" size="20" style="text-align:right;"/>
		  <input type="hidden" name="xbiaya" id="xbiaya" value=value="<?php echo ($row_edit['supir'] + $row_edit['bbm'] + $row_edit['tol']+$row_edit['parkir'] + $row_edit['akomod'] + $row_edit['other']); ?>"/>
          </label>
            <!--<label>
          <input name="checkbox" type="checkbox" id="checkbox" onclick="if(this.checked) { javascript:this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value; this.form.ntotal.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value + (2*this.form.hargasatuan.value) - this.form.hargasatuan.value}" checked="checked"/>
        </label>
        <small>Hitung Total Biaya</small>--></td>
	</tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Tanggal Kembali :</td>
      <td valign="top" bgcolor="#FFFFFF"><label>
        <input name="checkout" type="text" readonly="readonly" class="calendar" id="checkout" value="<?php echo $row_edit['checkout'];?>" size="12" maxlength="12"/>
        </label>
        - Jam :
  <label>
  <input name="waktucheckout" type="text" class="jam" id="waktucheckout" value="<?php echo $row_edit['waktucheckout'];?>" size="5" maxlength="5"/>
</label></td>
      <td valign="top" bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right" valign="top">Deposit : </td>
      <td valign="top" bgcolor="#FFFFFF"><input name="deposit" readonly="readonly" type="text" id="deposit" value="0" size="20" maxlength="10" onchange="javascript:this.form.biaya.value = (2*this.form.supir.value) - this.form.supir.value + (2*this.form.bbm.value) - this.form.bbm.value + (2*this.form.tol.value) - this.form.tol.value + (2*this.form.parkir.value) - this.form.parkir.value + (2*this.form.akomodasi.value) - this.form.akomodasi.value + (2*this.form.other.value) - this.form.other.value" style="text-align:right;"/></td>
    </tr>
    <tr valign="top">
      <td align="right" bgcolor="#FFFFFF">Pengemudi : </td>
      <td bgcolor="#FFFFFF"><input type="hidden" name="pengemudi" id="pengemudi" value="<?php echo $row_edit['pengemudi']; ?>" />
          <?php list($idpengemudi,$pengemudi) = mysql_fetch_row(mysql_query("select id,nama from gl_kontak where id = '$row_edit[pengemudi]'"));?>
           <input type="hidden" name="idpengemudi" id="idpengemudi" readonly="readonly" value="<?php echo $row_edit['id']; ?>" size="28" />
          <input type="text" name="txtpengemudi" id="txtpengemudi" readonly="readonly" value="<?php echo $row_edit['nama']; ?>" size="28" style="background-color:#fff;border:1px solid #999; height:16px;" onclick="NewWindow('index.php?component=kontak&task=listsupir&open=window','name','825','450','yes');return false" />
        </td>
      <td align="right">&nbsp;</td>
      <td colspan="2" align="right">Uang Muka : </td>
      <td bgcolor="#FFFFFF">
	  <input name="uangmuka" type="text" id="uangmuka" readonly="readonly" value="0" size="20" maxlength="10" onkeyup="javascript: if(this.value==''){ this.value='0'; } this.value=parseInt(this.value); var total=parseInt(document.getElementById('bbm').value) + parseInt(document.getElementById('tol').value) + parseInt(document.getElementById('parkir').value) + parseInt(document.getElementById('supir').value) + parseInt(document.getElementById('akomodasi').value) + parseInt(document.getElementById('other').value); 
var grandtotal = parseInt(document.getElementById('hargasatuan').value) + parseInt(document.getElementById('hargaafterppn').value) + total - parseInt(document.getElementById('uangmuka').value) - parseInt(document.getElementById('txtdiskon').value - parseInt(document.getElementById('hargaafterpph').value););
document.getElementById('biaya').value=total; document.getElementById('ntotal').value=grandtotal; " style="text-align:right;" />	  </td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Cso Oder :</td>
      <td valign="top" bgcolor="#FFFFFF"><label>
	    <input name="recipient" type="hidden" id="recipient" value="<?php echo $row_edit['recipient'];?>" />
		<input name="namarecipient" readonly="readonly" type="text" id="namarecipient" value="<?php echo $row_edit['created_by'];?>" />

      </label></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <th colspan="2" align="right" valign="top"> Grand Total :</th>
      <td valign="top"><label>
        <input name="ntotal" type="text" id="ntotal" value="<?php $subt = intval($row_edit['hargasatuan'] * $row_edit['jmlhr'] - ($row_edit['diskonamount']) + ($row_edit['supir'] + $row_edit['bbm'] + $row_edit['tol']+$row_edit['parkir'] + $row_edit['akomod'] + $row_edit['other']) + $row_edit['ppn'] - $row_edit['pph']); echo $subt;?>" size="20" maxlength="10" onfocus="this.blur();" style="text-align:right;"/>
        </label>
         
          a_kas<input name="a_kas" type="text" id="a_kas" value="<?php echo $row_gudang[''];?>" />
          a_piu<input name="a_piu" type="text" id="a_piu" value="<?php echo $row_getpiu['a_piu'];?>" />
          a_beb<input name="a_beb" type="text" id="a_beb" value="<?php echo $row_getbeb['a_beb'];?>" />
          a_paj<input name="a_paj" type="text" id="a_paj" value="<?php echo $row_getpaj['a_paj'];?>" />

          a_pend<input name="a_pend" type="text" id="a_pend" value="<?php echo $row_getpnd['a_pend'];?>" />
          a_jasadriver<input name="a_jasadriver" type="text" id="a_jasadriver" value="<?php echo $row_getjasadriver['a_jasadriver'];?>" />
          a_insentifdriver<input name="a_insentifdriver" type="text" id="a_insentifdriver" value="<?php echo $row_getinsentifdriver['a_insentifdriver'];?>" />
          a_bbm<input name="a_bbm" type="text" id="a_bbm" value="<?php echo $row_getbbm['a_bbm'];?>" />
          a_pph<input name="a_pph" type="text" id="a_pph" value="<?php echo $row_getpph['a_pph'];?>" />
          a_uangmuka<input name="a_uangmuka" type="text" id="a_uangmuka" value="<?php echo $row_gudang[''];?>" />
          a_deposit	<input name="a_deposit" type="text" id="a_deposit" value="<?php echo $row_gudang[''];?>" />
          
         
          <input name="jenis" type="hidden" id="jenis" value="7" /></td>
    </tr>
    <tr>
      <td align="right" valign="top" bgcolor="#FFFFFF">Detail Transaksi :</td>
      <td valign="top" bgcolor="#FFFFFF"><label>
        <textarea name="transaksi" cols="35" rows="2" id="transaksi"><?php echo $row_edit['transaksi']; ?></textarea>
      </label></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="2" align="right" valign="top">Keterangan :</td>
      <td valign="top"><div id="divKeterangan">
          <textarea name="keterangan" cols="40" rows="2" id="keterangan"><?php echo $row_edit['keterangan']; ?></textarea>
          <input name="cid" type="hidden" id="cid" value=""/>
      </div></td>
    </tr>
    
    
    <tr>
      <td align="left" bgcolor="#FFFFFF"><input name="id_hutang" type="hidden" id="id_hutang" value="<?php echo $row_getidh['id']; ?>" />
        <input name="id_biaya" type="hidden" id="id_biaya" value="<?php echo $row_getbiaya['id']; ?>" />

        <input name="idpajak" type="hidden" id="idpajak" value="<?php echo $row_getpajak['id']; ?>" />
        <input name="id_transaksi" type="hidden" id="id_transaksi" value="<?php echo $row_tr['id'];?>" /></td>
      <td bgcolor="#FFFFFF"><input name="Save" type="submit" id="Save" value="Simpan Order" />
      <input name="Cancel" type="button" id="Cancel" value="Batal" onclick="javascript:history.go(-1);"/></td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td colspan="3" align="center" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
  </table>
</form>
<script>window.document.getElementById('jmlhwkt').focus();</script>